<!DOCTYPE html>
<!--
Copyright 2013 The Polymer Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
<html>
  <head>
    <title>Strawkit Test</title>
    <script src="../../tools/test/htmltest.js"></script>
    <script src="../../node_modules/chai/chai.js"></script>
    <!-- -->
    <script src="../../platform.js" debug></script>
    <script src="includes/strawkit.js"></script>
  </head>
  <body>
    <x-foo></x-foo>
    <element name="x-foo">
      <template>
        If it's blue (<i><content></content></i>), then IT LIVES! 
      </template>
      <script>
        Polymer.register(this, {
          created: function() {
            this.textContent = 'cordon bleu';
            this.blueate();
          },
          blueate: function() {
            this.style.backgroundColor = 'lightblue';
          }
        });
      </script>
    </element>
    <script>
      window.addEventListener('WebComponentsReady', function() {
        var assert = chai.assert;
        var elt = document.querySelector('x-foo');
        assert.ok(elt, 'x-foo not found');
        assert.equal(elt.textContent, 'cordon bleu', 
            'x-foo has wrong textContent');
        assert.match(elt.style.backgroundColor, /lightblue|rgb\(173, 216, 230\)/, 
          'x-foo has wrong backgroundColor');
        assert.ok(elt.shadowRoot, 'shadowRoot not available as `.shadowRoot`');
        done();
      });
    </script>
  </body>
</html>
